package io.renren.modules.blog.dto;

import java.util.Date;

import io.renren.common.validator.group.AddGroup;
import io.renren.common.validator.group.DefaultGroup;
import io.renren.common.validator.group.UpdateGroup;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotNull;
import javax.validation.constraints.Null;
import java.io.Serializable;

@Data
@ApiModel(value = "文章表")
public class BlogArticleDto implements Serializable {
    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "主键")
    @Null(message = "{BlogArticle.id.require}", groups = AddGroup.class)
    @NotNull(message = "{BlogArticle.id.require}", groups = UpdateGroup.class)
    private Long id;

    @ApiModelProperty(value = "文章标题")
    @NotNull(message = "{BlogArticle.title.require}", groups = DefaultGroup.class)
    private String title;

    @ApiModelProperty(value = "文章描述")
    @NotNull(message = "{BlogArticle.description.require}", groups = DefaultGroup.class)
    private String description;

    @ApiModelProperty(value = "作者")
    private String author;

    @ApiModelProperty(value = "作者Id")
    private Long userId;

    @ApiModelProperty(value = "标签集合")
    private String tagIds;

    @ApiModelProperty(value = "分类")
    private String category;

    @ApiModelProperty(value = "分类Id")
    @NotNull(message = "{BlogArticle.categoryId.require}", groups = DefaultGroup.class)
    private Long categoryId;

    @ApiModelProperty(value = "封面")
    @NotNull(message = "{BlogArticle.cover.require}", groups = DefaultGroup.class)
    private String cover;

    @ApiModelProperty(value = "浏览量")
    private Integer browseNum;

    @ApiModelProperty(value = "内容")
    @NotNull(message = "{BlogArticle.content.require}", groups = DefaultGroup.class)
    private String content;

    @ApiModelProperty(value = "排序")
    @NotNull(message = "{BlogArticle.sort.require}", groups = DefaultGroup.class)
    private Integer sort;

    @ApiModelProperty(value = "创建时间")
    private Date createDate;

    @ApiModelProperty(value = "更新时间")
    private Date updateDate;

}
